/*
 * anima/firmware.cc - Generic firmware functions.
 * Copyright (C) 2007  Mikhail Vorozhtsov
 * See the LICENSE section of the README file for details.
 */

/* $Id$ */

#include HEADER (anima,firmware.hh)

START_NAMESPACE (anima)

bool
firmware::region_t::find (u64_t addr, region_t &region)
{
  const void *ptr = next (NULL, region);

  for (; ptr; ptr = next (ptr, region))
    {
      if (region.addr <= addr
          && addr < region.addr + region.size)
        return true;
    }

  return false;
}

END_NAMESPACE

